
<?php 
	echo $this->element('menu'); 
  $name=$this->requestAction('Users/view');
	$currentUserInfo = $this->Session->read('Auth');
	$userId = $currentUserInfo['User']['id'];

?>
<div id="display-image">
  <div class="navbar navbar-fixed-top" style="margin-top: 250px;" role="navigation">
      <div class="container">
          <div class="header">
              <div class="header_left">
              <?php
                if($userId == $image['UserImageBoard']['user_id']){
              ?>
                <a href="/pinterest/Boards/deleteImageInBoard/<?php echo $image['UserImageBoard']['id']; ?>/<?php echo $image['UserImageBoard']['board_id']; ?>">
                  <button type="button" class="btn btn-default ">
                      <span class="glyphicon glyphicon-pushpin"></span> unPin
                  </button>
                </a>
              <?php
                }else{
              ?>
                <a href="/pinterest/Boards/pinImageIntoBoard/<?php echo $image['UserImageBoard']['id']; ?>/<?php echo $image['UserImageBoard']['board_id']; ?>">
                  <button type="button" class="btn btn-default ">
                      <span class="glyphicon glyphicon-pushpin"></span> Pin
                  </button>
                </a>
              <?php
                  }
              ?>
              </div>
              <div class="header_right"> 
              <?php
                if($image['UserLike']){
              ?>
                <a href="/pinterest/UserLikes/unlikeImage/<?php echo $image['UserImageBoard']['id']; ?>">
                  <button type="button" class="btn btn-default ">
                        <span class="glyphicon glyphicon-heart"></span> unLike
                  </button>
                </a>
              <?php
                }else{
              ?>
                <a href="/pinterest/UserLikes/likeImage/<?php echo $image['UserImageBoard']['id']; ?>">
                  <button type="button" class="btn btn-default ">
                        <span class="glyphicon glyphicon-heart"></span> Like
                  </button>
                </a>
              <?php
                }
              ?>
                <a href="/pinterest/UserImageBoards/listImages">
                  <button type="button" class="btn btn-default " onclick="window.location.replace(document.referrer);">
                    <span class="glyphicon glyphicon-remove"></span> Close
                  </button> 
                </a>
              </div>
              
          </div>
        </div>
  </div>

    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="jumbotron">
      <div class="container">
        <div class="col-md-12">
          <div class="display_extensions">
            
            <div class="wrapper_img_display">
              <?php
                echo $this->Html->image($image['Image']['url'],array(
                                      'alt'=>'CakePHP',
                                      'class'=>'img_display_extensions',
                                      'width'=>'100%',
                                      'height'=>'100%'));
              ?>
            </div>          
          </div>
        </div>

        <div class="col-md-12">
          <div class="wrapper_commend">
            <div class="im_commend">
              <div class="left_commend">
                <a href="/pinterest/Users/view/<?php echo $image['Profile']['user_id'];?>">
                <?php
                  echo $this->Html->image($image['Profile']['avatar'],array(
                                        'alt'=>'CakePHP',
                                        'class'=>'img_display_extensions',
                                        'width'=>'100%',
                                        'height'=>'100%'));
                ?>
                </a>
              </div>
              <div class="right_commend">
                <div class="user_name">
                  <p><?php echo $image['Profile']['name']; ?></p>
                </div>
                <div class="descriptions_commend">
                  <p><?php echo $image['UserImageBoard']['description']; ?></p>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="col-md-12">
          <div class="wrapper_commend">
            <div class="im_commends">
          	<?php foreach ($usercomments as $usercomment) { ?>
              <div class="col-md-12">
              <div class="left_commend">
                <a href="/pinterest/Users/view/<?php echo $usercomment['Profile']['user_id'];?>">
                <?php
                
                  echo $this->Html->image($usercomment['Profile']['avatar'],array(
                                        'alt'=>'CakePHP',
                                        'class'=>'img_display_extensions',
                                        'width'=>'100%',
                                        'height'=>'100%'));
                ?>
                </a>
              </div>
              <div class="right_commend">
                <div class="user_name">
                  <p><?php echo $usercomment['Profile']['name']; ?></p>
                </div>
                <div class="user_name">
                  <p><?php echo $usercomment['UserComment']['updated']; ?>
                  <?php if(($image['UserImageBoard']['user_id']==$userId)||($usercomment['User']['id']==$userId)){ ?>
                  <a href="/pinterest/UserComments/delete/<?php echo $usercomment['UserComment']['id']; ?>">Delete</a>
                  <?php } ?>
                  </p>
                </div>
                <div class="descriptions_commend">
                  <p><?php echo $usercomment['UserComment']['content']; ?></p>
                </div>
                
              </div>
             </div>
            <?php } ?>
            </div>
          </div>
        </div>

        <div class="col-md-12">
          <div class="wrapper_commend">
            
            <div class="client_commend">
              <div class="left_commend">
                <a href="">
                <?php
                  echo $this->Html->image($name['Profile']['avatar'],array(
                                        'alt'=>'CakePHP',
                                        'class'=>'img_display_extensions',
                                        'width'=>'100%',
                                        'height'=>'100%'));
                ?>
                </a>
              </div>
              <div class="right_commend">
               
                  <?php 
                    echo $this->Form->create();
                    echo $this->Form->input('comment',array('label'=>'Write Comment'));
                    echo $this->Form->end('Comment');
                  ?>

                </div>
              </div>
          </div>
        </div> 
            
      </div>
    </div>
 
</div>